﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GSLMS.Entity;
using GSLMS.Core;

namespace GSLMS.WebAPP.Areas.HighAudit.Controllers.DirectorAdu
{
    public class DirectorAduController : AdminBaseController
    {

        protected override string navTabId
        {
            get { return "HighAudit_DirectorAdu"; }
        }

        //
        // GET: /HighAudit/DirectorAdu/

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 待办事项
        /// </summary>
        /// <returns></returns>
        public ActionResult Gtasks()
        {
            var list = new List<TB_APP_SHOULDDOINFO>();
            list = serviceAppAudit.GetHighAuditShouldDoList(CurentUser.UserName);

            return View(list);
        }

        /// <summary>
        /// 已办事项
        /// </summary>
        /// <returns></returns>
        public ActionResult Htasks()
        {
            return View();
        }

        #region 立项申请

            public ActionResult GApplyAudit(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetHighAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VApplyAudit(long id, long auditID)
            {
                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetHighAuditInfo((long)id);
                ViewData["IsHighAuditRetract"] = serviceAppAudit.IsHighAuditRetract(id, auditID);
                
                return View(model);
            }

            [HttpPost]
            public string GApplyAudit(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();
                var proModel = new TB_APP_PROINFO();
                var AduConSchemeList = new List<TB_ADU_CONSCHEME>();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);

                TryUpdateModel(proModel, form);

                //同意
                if (model.AUDITRESULT == 1 && (proModel.AduConSchemeList == null || proModel.AduConSchemeList.Count == 0))
                {
                    result = string.Format(ajaxStr, 300, ResourceManager.NeedConScheme, navTabId, "", "");
                }
                else
                {
                    model.AduConSchemeList = proModel.AduConSchemeList;
                }

                if (result == null || result == string.Empty)
                {
                    try
                    {
                        int num = 0;
                        num = serviceAppAudit.ToHighAudit(model);
                        if (num == 1)
                        { result = AjaxResultSucess; }
                        else
                        { result = AjaxResultFail; }
                    }
                    catch (Exception ex)
                    {
                        base.ExceptionHand(ex);
                        result = AjaxResultFail;
                    }

                }
                return "{" + result + "}";
            }

            public ActionResult HApplyAudit(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetHighAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();
                ViewData["systemID"] = EnumHelper.ToSelectList<GSLMS.Entity.Enum.ApplyEnum.RegSystemID>();
                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }
        #endregion


        #region 特批申请


            public ActionResult GSpecailAudit(long id)
            {

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "username");
                var model = serviceSpecailInfo.GetByID(id);
                ViewData["AuditInfo"] = serviceSpecail.GetAllByTypeAndPID(id, 5);
                //判断是否终审用户
                ViewData["LastAuditUser"] = serviceSysAuditSet.CheckIsLastAuditUser(5, CurentUser.UserName) ? 1 : 0;

                return View(model);
            }


            public ActionResult VSpecailAudit(long id)
            {

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "username");
                var model = serviceSpecailInfo.GetByID(id);
                ViewData["AuditInfo"] = serviceSpecail.GetAllByTypeAndPID(id, 5);
                

                return View(model);
            }

            [HttpPost]
            public string GSpecailAudit(FormCollection form)
            {
                string result = string.Empty;
                var model = new TB_ADU_SPECAIL();

                model.PID = Request["id"] == null ? 0 : Core.Helper.ToLong(Request["id"]);
                model.SUBMITDEPART = CurentUser.CurrentUserInfo.ORGID;
                model.SUBMITUSER = CurentUser.UserName;
                model.REMARK = Request["Remark"] == null ? "" : Request["Remark"];
                model.TOUSER = Request["toUser"] == null ? "" : Request["toUser"];
                model.AUDITSTATUS = Request["hidActiondo"] == null ? 0 : Core.Helper.ToInt(Request["hidActiondo"]);

                try
                {
                    bool isSumbit = false;
                    if (!serviceSysAuditSet.CheckIsLastAuditUser(5, CurentUser.UserName) && model.TOUSER == "")
                    {
                        result = string.Format(ajaxStr, 300, "请选择提交到。", navTabId, "", "");
                    }
                    else
                    {
                        isSumbit = serviceSpecail.SpecailBMAudit(model);
                        if (isSumbit)
                        { result = AjaxResultSucess; }
                        else
                        { result = AjaxResultFail; }

                    }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HSpecailAudit(FormCollection form)
            {

                ViewData["Product"] = new SelectList(serviceSysProduct.GetBySysetmID(Entity.Enum.SystemEnum.SystemID.典当, -1), "id", "productname");
                var searchParam = base.SearchPara<TB_ADU_SPECAIL>(form, new TB_ADU_SPECAIL());

                searchParam.SUBMITUSER = CurentUser.UserName;
                var model = serviceSpecail.GetSpecailList(searchParam) ?? new List<TB_ADU_SPECAIL>();
                ViewData["systemID"] = EnumHelper.ToSelectList<GSLMS.Entity.Enum.ApplyEnum.RegSystemID>();
                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }

        #endregion

        #region 展期申请


            public ActionResult GExtAudit(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VExtAudit(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GExtAudit(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);
                model.TOUSER = Request["toUser"];

                if (model.AUDITRESULT == 1 && model.TOUSER.Trim() == "")
                    model.TOUSER = "001";



                try
                {
                    int num = 0;
                    num = serviceAppAudit.DirectorAudit(model);
                    if (num == 1)
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HExtAudit(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetDirectorAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();

                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }
           
        #endregion

        #region 费用减免申请



            public ActionResult GFeesFree(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VFeesFree(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GFeesFree(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);
                model.TOUSER = Request["toUser"];

                if (model.AUDITRESULT == 1 && model.TOUSER.Trim() == "")
                    model.TOUSER = "001";



                try
                {
                    int num = 0;
                    num = serviceAppAudit.DirectorAudit(model);
                    if (num == 1)
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HFeesFree(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetDirectorAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();

                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }

        #endregion

        #region 贷款审议

            public ActionResult GConAudit(long id)
            {

                var model = serviceProInfo.GetByID(id);
                ViewData["ConAduFlag"] = 0;
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetRiskAuditConAduAuditInfo(id);
                return View(model);
            }


            public ActionResult VConAudit(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GConAudit(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_ADU_CONADU();

                model.ID = 0;
                model.OPINION = Request["AuditContent"];
                model.ADURESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.ARRID = 0;//存储过程中通过proid取
                model.AUDITTIME = DateTime.Now;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);




                try
                {
                    if (serviceAduConAdu.Add(model))
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HConAudit(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_ADU_CONARR>(form, new TB_ADU_CONARR());
                searchParam.ConAduBy = CurentUser.UserName;
                searchParam.ConAduID = CurentUser.CurrentUserInfo.ID;

                //已审批
                searchParam.STATUS = 0;
                searchParam.STATUS2 = 1;

                var model = serviceAduConArr.GetConAduList(searchParam);
                ViewData["RowCount"] = searchParam.RowCount;
                ViewData["systemID"] = EnumHelper.ToSelectList<GSLMS.Entity.Enum.ApplyEnum.RegSystemID>();
                return View(model);
            }


        #endregion

        #region 贷款合同

            public ActionResult GLoanCon(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VLoanCon(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GLoanCon(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);
                model.TOUSER = Request["toUser"];

                if (model.AUDITRESULT == 1 && model.TOUSER.Trim() == "")
                    model.TOUSER = "001";



                try
                {
                    int num = 0;
                    num = serviceAppAudit.DirectorAudit(model);
                    if (num == 1)
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HLoanCon(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetDirectorAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();

                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }
        #endregion

        #region 出款申请

            public ActionResult GLoanApply(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VLoanApply(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GLoanApply(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);
                model.TOUSER = Request["toUser"];

                if (model.AUDITRESULT == 1 && model.TOUSER.Trim() == "")
                    model.TOUSER = "001";



                try
                {
                    int num = 0;
                    num = serviceAppAudit.DirectorAudit(model);
                    if (num == 1)
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HLoanApply(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetDirectorAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();

                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }
        #endregion

        #region 拆借借入
            public ActionResult GExcLoanIn(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VExcLoanIn(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GExcLoanIn(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);
                model.TOUSER = Request["toUser"];

                if (model.AUDITRESULT == 1 && model.TOUSER.Trim() == "")
                    model.TOUSER = "001";



                try
                {
                    int num = 0;
                    num = serviceAppAudit.DirectorAudit(model);
                    if (num == 1)
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HExcLoanIn(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetDirectorAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();

                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }
        #endregion

        #region 拆借借出
            public ActionResult GExcLoanOut(int id)
            {

                var model = serviceProInfo.GetByID((long)id);
                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo((long)id);
                return View(model);
            }


            public ActionResult VExcLoanOut(long id, long auditID)
            {

                var model = serviceProInfo.GetByID(id);
                var directorAuditModel = serviceAppAudit.GetDirectorAuditByID(auditID);
                ViewData["directorAuditModel"] = directorAuditModel;

                ViewData["FinalApprover"] = new SelectList(serviceEmp.GetUserPrivEffList("", ""), "username", "empname");
                ViewData["AuditInfo"] = serviceAppAudit.GetDirectorAuditInfo(id);
                ViewData["IsDirectorAuditRetract"] = serviceAppAudit.IsDirectorAuditRetract(id, auditID);
                return View(model);
            }

            [HttpPost]
            public string GExcLoanOut(FormCollection form)
            {
                string result = string.Empty;
                var model = new GSLMS.Entity.TB_APP_DIRECTORAUDIT();

                model.ID = 0;
                model.AUDITCONTENT = Request["AuditContent"];
                model.AUDITRESULT = GSLMS.Core.Helper.ToInt(Request["hidActiondo"]);
                model.AUDITBY = CurentUser.UserName;
                model.PROID = GSLMS.Core.Helper.ToLong(Request["id"]);
                model.TOUSER = Request["toUser"];

                if (model.AUDITRESULT == 1 && model.TOUSER.Trim() == "")
                    model.TOUSER = "001";



                try
                {
                    int num = 0;
                    num = serviceAppAudit.DirectorAudit(model);
                    if (num == 1)
                    { result = AjaxResultSucess; }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }

                return "{" + result + "}";
            }

            public ActionResult HExcLoanOut(FormCollection form)
            {

                var searchParam = base.SearchPara<TB_APP_DIRECTORAUDIT>(form, new TB_APP_DIRECTORAUDIT());
                searchParam.AUDITBY = CurentUser.UserName;
                searchParam.StrSort = " id desc";
                var model = serviceAppAudit.GetDirectorAuditList(searchParam) ?? new List<TB_APP_DIRECTORAUDIT>();

                ViewData["SearchParma"] = searchParam;
                ViewData["RowCount"] = searchParam.RowCount;
                return View(model);
            }
        #endregion


    }
}
